package com.example.role.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.management.relation.Role;
import java.util.List;

/**
 * @BelongsProject: shared_parking
 * @BelongsPackage: com.example.role.mapper
 * @Author: 段彪
 * @CreateTime: 2020-06-11 10:20
 * @Description: dao层
 */
public interface RoleMapper {

    //查询所有
    List<Role> getAll();
    //根据id获取某个对象
    @Select("select * from role where r_id =#{rId}")
    Role getRoleById(String rId);
    //根据字段获取某个对象
    @Select("select * from role where role_name =#{roleName}")
    Role getRoleByName(String roleName);
    //添加对象
    Integer addRole(Role role);
//    登录
//    User login(User user);
//    检测注册名是否有效
//    Integer checkValid(String username);
   //通过id逻辑删除一个对象
    Integer deleteRoleById(String rId);
    //根据id来条件修改一个对象(修改啥填啥)
    Integer updateRoleName(String rId,String roleName);

}
